package b1.mobile.blackberry.ui.component;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.component.BitmapField;

public class ImageButton extends BitmapField {
	private Bitmap image;
	private Bitmap focusImage ;
	public ImageButton(Bitmap image,Bitmap focusImage ) {
		super(image, BitmapField.FOCUSABLE);
		this.image = image;
		this.focusImage = focusImage ;
	}
	
	public ImageButton(String image,String focusImage ) {
		super(Bitmap.getBitmapResource(image), BitmapField.FOCUSABLE);
		this.image = Bitmap.getBitmapResource(image);
		this.focusImage = Bitmap.getBitmapResource(focusImage) ;
	}
	
	public ImageButton(String image) {
		super(Bitmap.getBitmapResource(image), BitmapField.FOCUSABLE);
		this.image = Bitmap.getBitmapResource(image);
		this.focusImage = Bitmap.getBitmapResource(image);
	}
	
	
	protected void drawFocus(Graphics graphics, boolean on) {
		graphics.drawBitmap(0, 0, focusImage.getWidth(), focusImage
				.getHeight(), focusImage, 0, 0);
	};
}